<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>ws client</title>
</head>
<body>

</body>
<script>
    let ws = new WebSocket('ws://localhost:8080/myWs1');
    //打开websocket来连接后立刻发送一条消息:
    ws.onopen = function(){
        ws.send("hello");
    };

    // 收到消息后打印：
    ws.onmessage = function(message){
        console.log(message.data);
    }
</script>
</html>
